﻿using System.ComponentModel;
using nRoute.Components;

namespace nRoute.Samples.SquareAway.Model
{
    public class Square
        : INotifyPropertyChanged
    {
        private int _row;
        private int _column;
        private SquareState _state;
        private SquareColor _color;

        public int Row
        {
            get { return _row; }
            set
            {
                if (_row != value)
                {
                    _row = value;
                    PropertyChanged.Notify(() => Row);
                }
            }
        }

        public int Column
        {
            get { return _column; }
            set
            {
                if (_column != value)
                {
                    _column = value;
                    PropertyChanged.Notify(() => Column);
                }
            }
        }

        public SquareState State
        {
            get { return _state; }
            set
            {
                if (_state != value)
                {
                    _state = value;
                    PropertyChanged.Notify(() => State);
                }
            }
        }

        public SquareColor Color
        {
            get { return _color; }
            set
            {
                if (_color != value)
                {
                    _color = value;
                    PropertyChanged.Notify(() => Color);
                }
            }
        }

#region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

#endregion



    }
}
